# Configure LitwareHR Application Pool
# & $env:windir\system32\inetsrv\appcmd.exe delete APPPOOL "LitwareHRAppPool" | out-null
# & $env:windir\system32\inetsrv\appcmd.exe add APPPOOL /name:"LitwareHRAppPool" /processModel.identityType:"SpecificUser" /processModel.userName:"Provisioning" /processModel.password:"P@ssW0rd" | out-null

# Configure Contoso Website to IIS
& $env:windir\system32\inetsrv\appcmd.exe delete site "Contoso" | out-null
$contosoLocation = (resolve-path ..\solution\Contoso\Contoso.WebSite)
& $env:windir\system32\inetsrv\appcmd.exe add site /name:"Contoso" /bindings:"http://www.contoso.com:80" /physicalpath:$contosoLocation | out-null
& $env:windir\system32\inetsrv\appcmd.exe start site "Contoso" | out-null

# Configure Fabrikam Website to IIS
& $env:windir\system32\inetsrv\appcmd.exe delete site "Fabrikam" | out-null
$fabrikamLocation = (resolve-path ..\solution\Fabrikam\Fabrikam.WebSite)
& $env:windir\system32\inetsrv\appcmd.exe add site /name:"Fabrikam" /bindings:"http://www.fabrikam.com:80" /physicalpath:$fabrikamLocation | out-null
& $env:windir\system32\inetsrv\appcmd.exe start site "Fabrikam" | out-null

# Configure Litware Website to IIS
& $env:windir\system32\inetsrv\appcmd.exe delete site "Litware" | out-null
$litwareLocation = (resolve-path ..\solution\LitwareHR\Litware.WebSite)
& $env:windir\system32\inetsrv\appcmd.exe add site /name:"Litware" /bindings:"http://www.litware.com:80" /physicalpath:$litwareLocation  | out-null
& $env:windir\system32\inetsrv\appcmd.exe start site "Litware" | out-null

# Configure LitwareHR Website to IIS
& $env:windir\system32\inetsrv\appcmd.exe delete site "LitwareHR" | out-null
$litwareHRLocation = (resolve-path ..\bin\EmptyVD)
& $env:windir\system32\inetsrv\appcmd.exe add site /name:"LitwareHR" /bindings:"http://www.litwareHR.com:80" /physicalpath:$litwareHRLocation | out-null
& $env:windir\system32\inetsrv\appcmd.exe start site "LitwareHR" | out-null

# Configure LitwareHR Services Website to IIS
& $env:windir\system32\inetsrv\appcmd.exe delete site "LitwareHR Services" | out-null
$litwareHRServicesLocation = (resolve-path ..\bin\EmptyVD)
& $env:windir\system32\inetsrv\appcmd.exe add site /name:"LitwareHR Services" /bindings:"http://services.litwareHR.com:80" /physicalpath:$litwareHRServicesLocation | out-null

# Configure Authorization Service Host to IIS
$authorizationServicesLocation = (resolve-path ..\solution\LitwareHR\LitwareHR.Authorization.SvcHost)
& $env:windir\system32\inetsrv\appcmd.exe add app /site.name:"LitwareHR Services" /path:/Authorization /physicalpath:$authorizationServicesLocation | out-null

# Configure Authentication Service Host to IIS
$authenticationServicesLocation = (resolve-path ..\solution\LitwareHR\LitwareHR.Authentication.SvcHost)
& $env:windir\system32\inetsrv\appcmd.exe add app /site.name:"LitwareHR Services" /path:/Authentication /physicalpath:$authenticationServicesLocation | out-null

# Configure Authentication Service Host to IIS

$authenticationServicesLocation = (resolve-path ..\solution\LitwareHR\LitwareHR.Authentication.SvcHost)
& $env:windir\system32\inetsrv\appcmd.exe add app /site.name:"LitwareHR Services" /path:/Authentication /physicalpath:$authenticationServicesLocation | out-null

# Configure Secured Service Host to IIS
$securedServiceHostLocation = (resolve-path ..\solution\LitwareHR\LitwareHR.Portfolio.SecureHost)
& $env:windir\system32\inetsrv\appcmd.exe add app /site.name:"LitwareHR Services" /path:/SecureHost /physicalpath:$securedServiceHostLocation | out-null

# Configure Secured Service Host to IIS
$unSecuredServiceHostLocation = (resolve-path ..\solution\LitwareHR\LitwareHR.Portfolio.UnSecureHost)
& $env:windir\system32\inetsrv\appcmd.exe add app /site.name:"LitwareHR Services" /path:/UnSecureHost /physicalpath:$unSecuredServiceHostLocation | out-null
& $env:windir\system32\inetsrv\appcmd.exe start site "LitwareHR Services" | out-null


